class AddActivationToUsers < ActiveRecord::Migration
  def self.up
    add_column :users, :activation_code, :string, :limit => 40
    add_column :users, :activated_at, :datetime
    
    User.find(:all).each do |u|
      u.activated_at = Time.now
      u.save(false)
      puts "UPDATE: #{u.email}"
    end
  end

  def self.down
    remove_column :users, :activation_code
    remove_column :users, :activated_at
  end
end
